package com.copa.l231;

/**
 * @author copa
 * @createDate 2022-05-30 14:53
 * @function 位运算
 */
public class Test1 {

    public boolean isPowerOfTwo(int n) {
        // 位运算
        return n > 0 && (n & n - 1) == 0;
    }

    public static void main(String[] args) {
        System.out.println(new Test1().isPowerOfTwo(0));
    }
}
